<div class="problemindexholder" problemindex="B">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     B. The Eternal Immortality
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     1 second
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     <span class="tex-font-style-it">
      Even if the world is full of counterfeits, I still regard it as wonderful.
     </span>
    </p>
    <p>
     Pile up herbs and incense, and arise again from the flames and ashes of its predecessor — as is known to many, the phoenix does it like this.
    </p>
    <p>
     The phoenix has a rather long lifespan, and reincarnates itself once every
     <span class="tex-span">
      <i>
       a
      </i>
      !
     </span>
     years. Here
     <span class="tex-span">
      <i>
       a
      </i>
      !
     </span>
     denotes the factorial of integer
     <span class="tex-span">
      <i>
       a
      </i>
     </span>
     , that is,
     <span class="tex-span">
      <i>
       a
      </i>
      ! = 1 × 2 × ... ×
      <i>
       a
      </i>
     </span>
     . Specifically,
     <span class="tex-span">
      0! = 1
     </span>
     .
    </p>
    <p>
     Koyomi doesn't care much about this, but before he gets into another mess with oddities, he is interested in the number of times the phoenix will reincarnate in a timespan of
     <span class="tex-span">
      <i>
       b
      </i>
      !
     </span>
     years, that is,
     <img align="middle" class="tex-formula" src="/predownloaded/aa/b1/aab15f99ac54e43aef432308191efbfeae3fe192.png" style="max-width: 100.0%;max-height: 100.0%;"/>
     . Note that when
     <span class="tex-span">
      <i>
       b
      </i>
      ≥
      <i>
       a
      </i>
     </span>
     this value is always integer.
    </p>
    <p>
     As the answer can be quite large, it would be enough for Koyomi just to know
     <span class="tex-font-style-bf">
      the last digit of the answer in decimal representation
     </span>
     . And you're here to provide Koyomi with this knowledge.
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     The first and only line of input contains two space-separated integers
     <span class="tex-span">
      <i>
       a
      </i>
     </span>
     and
     <span class="tex-span">
      <i>
       b
      </i>
     </span>
     (
     <span class="tex-span">
      0 ≤
      <i>
       a
      </i>
      ≤
      <i>
       b
      </i>
      ≤ 10
      <sup class="upper-index">
       18
      </sup>
     </span>
     ).
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     Output one line containing a single decimal digit — the last digit of the value that interests Koyomi.
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>2 4<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>2<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>0 10<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>0<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>107 109<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>2<br/></pre>
     </div>
    </div>
   </div>
   <div class="note">
    <div class="section-title">
     Note
    </div>
    <p>
     In the first example, the last digit of
     <img align="middle" class="tex-formula" src="/predownloaded/f0/88/f0886ba56d5dd052f3c50422efafae9a7727e175.png" style="max-width: 100.0%;max-height: 100.0%;"/>
     is
     <span class="tex-span">
      2
     </span>
     ;
    </p>
    <p>
     In the second example, the last digit of
     <img align="middle" class="tex-formula" src="/predownloaded/7b/55/7b55306c32bb870c0ad4847db7814f269c5f6530.png" style="max-width: 100.0%;max-height: 100.0%;"/>
     is
     <span class="tex-span">
      0
     </span>
     ;
    </p>
    <p>
     In the third example, the last digit of
     <img align="middle" class="tex-formula" src="/predownloaded/0d/92/0d928d263151cd9b141a5cec7ecae89e98fd431b.png" style="max-width: 100.0%;max-height: 100.0%;"/>
     is
     <span class="tex-span">
      2
     </span>
     .
    </p>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
